﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tracnghiem.model
{
    class CauHoi : IObject
    {
        DataClassesDataContext context;

        public CauHoi()
        {
            context = new DataClassesDataContext();
        }

        public String createNewID()
        {
            var max = (from cauhoi in context.CAU_HOIs
                       select (int?)cauhoi.MA_CAU_HOI).Max() ?? 0; 
            
            return (max + 1).ToString();
        }

        public static string ToString()
        {
            return "CauHoi";
        }
    }
}
